using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace RBAC.Domain.Approval
{
    /// <summary>
    /// 审批节点实体
    [Table("ApprovalNode")]
    /// </summary>
    public class ApprovalNode : BaseEntity
    {
        /// <summary>
        /// 所属流程ID
        /// </summary>
        [Required]
        public long ProcessId { get; set; }

        /// <summary>
        /// 节点名称
        /// </summary>
        [Required]
        [StringLength(100)]
        public string NodeName { get; set; } = string.Empty;

        /// <summary>
        /// 审批人ID
        /// </summary>
        [Required]
        public long ApproverId { get; set; }

        /// <summary>
        /// 审批人姓名
        /// </summary>
        [Required]
        [StringLength(50)]
        public string ApproverName { get; set; } = string.Empty;

        /// <summary>
        /// 审批方式 (1:依次审批 2:会签审批 3:或签审批)
        /// </summary>
        [Required]
        public int ApprovalType { get; set; } = 1;

        /// <summary>
        /// 节点顺序
        /// </summary>
        [Required]
        public int NodeOrder { get; set; }

        /// <summary>
        /// 所属审批流程
        /// </summary>
        public virtual ApprovalProcess ApprovalProcess { get; set; }
    }
}
